import request from '@/plugins/request';
var pre = '/officeApply';
if (process.env.NODE_ENV !== "development") {
  pre = "/api/sa/epid-prevention" + pre;
}

// 查询防疫物资申请
export function getPageForApplys(data) {
  return request({
    url: `${pre}/page`,
    method: "post",
    data,
  });
}

// 防疫物资申请添加
export function add(data) {
  return request({
    url: `${pre}/add`,
    method: 'post',
    data
  });
}

// 防疫物资申请信息修改
export function edit(data) {
  return request({
    url: `${pre}/edit`,
    method: 'post',
    data
  });
}

// 删除防疫物资申请
export function del(data) {
  return request({
    url: `${pre}/del`,
    method: 'post',
    data
  });
}

// 根据id获取防疫物资申请信息
export function getById(AppId) {
  return request({
    url: `${pre}/get?AppId=${AppId}`,
    method: 'GET',
  });
}
//取消
export function cancel(AppId) {
  return request({
    url: `${pre}/cancel?AppId=${AppId}`,
    method: 'GET',
  });
}
// 防疫物资申请提交
export function officeAppSubmit(data) {
  return request({
    url: `${pre}/submit`,
    method: 'post',
    data
  });
}


var preUrl = "/StockTotalManagement"
if (process.env.NODE_ENV !== "development") {
  preUrl = "/api/sa/epid-prevention" + preUrl;
}
// 查询防疫物资信息
export function getPageForArticles(data) {
  return request({
    url: `${preUrl}/pageTotal`,
    method: "post",
    data,
  });
}

var cateUrl = "/categoryManagement"
if (process.env.NODE_ENV !== "development") {
  cateUrl = "/api/sa/epid-prevention" + cateUrl;
}
// 查询防疫物资分类
export function getSelectList() {
  return request({
    url: `${cateUrl}/getSelect`,
    method: "post",
  });
}
